Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'whitelist' argument to limit the subprocesses being monitored #597

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

WillRosen
Copy link

Hello!

The main reasoning behind this change is the following issue:
#561

This changes the thread that checks for new subprocesses, and calls a new ‘should_spy_process’ function to determine if the subprocess should be spied on. It currently checks if the process name if within the whitelist, if no whitelist is provided then it reverts to the old behaviour.

It is important this check happens before checking the symbols, so it will reduce the CPU usage as mentioned in the issue above.
Example usage:
py-spy.exe record -o speedscope.json -f speedscope --pid x --subprocesses --whitelist=python,pythonw,ect

Let me know what your thoughts are, many thanks!
William Rosen

WillRosen and others added 5 commits June 30, 2023 11:50
If used, this will limit the subprocesses we monitor to the whitelist
This backs out before doing an expensive check of the symbols
Also rename and neaten should_spy_process function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant